﻿@model PagedList.IPagedList<tutors_clus.Models.news>
@{
    ViewBag.Title = "Tin tức";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
    <div class="Breadcrumb">
        <ul>
            <li><a class="home" href="#"></a></li>
            <li>Tin tức</li>
        </ul>
    </div>
    @{Html.RenderAction("Search_News", "Home");}

    <div class ="content">
           
                   @foreach (var item in Model)
                   {
                       <div class="news">
                           <div class="img_news">@if (item.image_news == "" || item.image_news == null)                                                 
	                        {
                                  <img src="../Content/images/noimage.gif" alt="Alternate Text" style="width:100px;height:100px"/>                                  
		                    
	                        }
                            else
                            {
                                 <img src="@item.image_news" alt="Alternate Text" style="width:100px;height:100px"/>   
                             
                            }
                           </div>                                          
                           <div class="title_news">@Html.ActionLink(@item.title_new, "Detail_News", new { id = item.id_new}) <i>(@item.create_date_new)</i></div>
                           <div class="detail_news"> @MvcHtmlString.Create(item.detail_new.Substring(0,200))...</div>
                           <div class="readmore">@Html.ActionLink("xem tiếp", "Detail_News", new { id = item.id_new})</div>                      
                           <div class="line"></div>
                       </div>
                   
                   }
        <div>
        Trang @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) trong tổng số @Model.PageCount trang

        @if (Model.HasPreviousPage)
        {
            @Html.ActionLink("<<", "News", new { page = 1, order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
            @Html.Raw(" ");
            @Html.ActionLink("< Trước", "News", new { page = Model.PageNumber - 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        }
        else
        {
            @:<<
            @Html.Raw(" ");
            @:< Trước
        }
        @if (Model.HasNextPage)
        {
            @Html.ActionLink("Sau >", "News", new { page = Model.PageNumber + 1,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
            @Html.Raw(" ");
            @Html.ActionLink(">>", "News", new { page = Model.PageCount,  order = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        }
        else
        {
            @:Sau >
            @Html.Raw(" ")
            @:>>
        }
        </div>
          
    </div>
@*@{Html.RenderAction("list_courses","Home");}*@
@Html.ActionLink("Quay lại trang chủ", "Index")